//
//  DiscoverViewController.m
//  Weibo
//
//  Created by Anasue on 9/9/15.
//  Copyright (c) 2015 Anasue. All rights reserved.
//

#import "DiscoverViewController.h"
#import "SearchBar.h"
#import "CommonGroup.h"
#import "CommonItem.h"
#import "CommonCell.h"
#import "CommonArrowItem.h"
#import "CommonSwitchItem.h"
#import "CommonLabelItem.h"

@interface DiscoverViewController ()

@end

@implementation DiscoverViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    //搜索栏
    SearchBar *searchBar = [[SearchBar alloc]init];
    searchBar.width = 300;
    searchBar.height = 30;
    self.navigationItem.titleView = searchBar;
    
    [self setupGroups];
    
}

- (void)setupGroups
{
    [self setupGroup0];
    [self setupGroup1];
    [self setupGroup2];
    
}

- (void)setupGroup0
{
    CommonGroup *group = [CommonGroup group];
    [self.groups addObject:group];
    group.header = @"第0行头部";
    group.footer = @"第0行尾部";
    
    CommonArrowItem *hotStatus = [CommonArrowItem itemWithTitle:@"热门微博" icon:@"hot_status"];
    hotStatus.subTitle = @"笑话，娱乐，神最右都搬到这啦";
    CommonArrowItem *findPeople = [CommonArrowItem itemWithTitle:@"找人" icon:@"find_people"];
    findPeople.badgeValue = @"999";
    findPeople.subTitle = @"名人、有意思的人尽在这里";
    group.items = @[hotStatus,findPeople];
}

- (void)setupGroup1
{
    CommonGroup *group = [CommonGroup group];
    [self.groups addObject:group];
    CommonItem *gameCenter = [CommonItem itemWithTitle:@"游戏中心" icon:@"game_center"];
    CommonLabelItem *near = [CommonLabelItem itemWithTitle:@"周边" icon:@"near"];
    near.text = @"测试";
    CommonItem *app = [CommonItem itemWithTitle:@"应用" icon:@"app"];
    app.badgeValue = @"5";
    group.items = @[gameCenter, near, app];
}

- (void)setupGroup2
{
    CommonGroup *group = [CommonGroup group];
    [self.groups addObject:group];
    CommonSwitchItem *video = [CommonSwitchItem itemWithTitle:@"视频" icon:@"video"];
    CommonSwitchItem *music = [CommonSwitchItem itemWithTitle:@"音乐" icon:@"music"];
    CommonItem *movie = [CommonItem itemWithTitle:@"电影" icon:@"movie"];
    CommonItem *cast = [CommonItem itemWithTitle:@"播客" icon:@"cast"];
    cast.badgeValue = @"20";
    CommonItem *more = [CommonItem itemWithTitle:@"更多" icon:@"more"];
    
    group.items = @[video, music, movie, cast, more];

}

@end
